<span id="${uuid}"></span>
<div class="box_tc_s">
    <form data-id="form-horizontal-resource-search" method="post" action="${pageContext.request.contextPath}/app/api/resource/addResourceForJson">
        <table border="1" class="hydra-table" cellpadding="0" cellspacing="0">
            <tr class="hydra-tr-bg">
                <td class="hydra-left">资源名称：</td>
                <td class="hydra-right"><input type="text" data-id="resourceName"
                                               name="resourceName" class="hydra-input-width"
                                               data-options="validType:['normalChar','length[0,20]']"
                                               placeholder="资源名称.." value=""/></td>
            </tr>
            <tr>
                <td class="hydra-left">资源类型：</td>
                <td class="hydra-right">
                    <select data-id="resourceType_form" name="resourceType" class="hydra-input-width">
                        <option value="">全部</option>
                        <option value="menu">菜单</option>
                        <option value="button">按钮</option>
                    </select>
                </td>
            </tr>
            <tr>
                <td class="hydra-left">父级资源：</td>
                <td class="hydra-right">
                    <select name="parentId" data-id="parentId" class="hydra-input-width"></select>
            </tr>
            <tr class="hydra-tr-bg">
                <td class="hydra-left">资源状态：</td>
                <td class="hydra-right">
                    <select data-id="available" name="available" class="hydra-input-width">
                        <option value="">全部</option>
                        <option value="1">启用</option>
                        <option value="0">禁用</option>
                    </select>
                </td>
            </tr>
        </table>
    </form>
</div>
<script type="text/javascript">

    (function ($) {
        var uuid = "${uuid}";
        var page = new $.PageDomFactory(uuid);
        page.getJqDom("resourceType").combobox({
            editable: false
        });        
        page.getJqDom("resourceType_form").combobox({
            editable: false
        });
        page.getJqDom("available").combobox({
            editable: false
        });
        page.getJqDom("parentId").resourceSelect({
            url:"${ctx}/app/api/resource/queryResourceByPageForJson?resourceType=menu",
            panelWidth:660
        });
        $[uuid] = {
            pageFactory: page
        }
    })(jQuery);

    function resource_search(win) {
        win.wait("start", "搜索中,请稍候.");
        var form = $["${uuid}"].pageFactory.getJqDom("form-horizontal-resource-search");
        var postData = form.serializeJson();
        win.callback($.utils.buildJson(postData));
        win.close();
    }
</script>
